﻿@model PagedList<Customer>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/css/select.css" rel="stylesheet" type="text/css" />
    <link href="/css/userinfostyle.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/js/jquery.js"></script>
    <script type="text/javascript" src="/js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="/js/select-ui.min.js"></script>
    <script language="javascript">
        $(function () {
            //导航切换
            $(".imglist li").click(function () {
                $(".imglist li.selected").removeClass("selected")
                $(this).addClass("selected");
            })
        })
    </script>
    <script type="text/javascript">
        $(document).ready(function () {

            $('#form1').find("select[name='FirstArea']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='FirstArea']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='FirstArea']").prev().find("em:first").text($('#ul1').find("select[name='FirstArea']").find("option:selected").text());



            $('#form1').find("select[name='SecondArea']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='SecondArea']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='SecondArea']").prev().find("em:first").text($('#ul1').find("select[name='SecondArea']").find("option:selected").text());


            $('#form1').find("select[name='CustomerStat']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='CustomerStat']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='CustomerStat']").prev().find("em:first").text($('#ul1').find("select[name='CustomerStat']").find("option:selected").text());
             
            $('#form1').find("select[name='HouseType']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='HouseType']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='HouseType']").prev().find("em:first").text($('#ul1').find("select[name='HouseType']").find("option:selected").text());


            $('#form1').find("select[name='WaterTypeId']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='WaterTypeId']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='WaterTypeId']").prev().find("em:first").text($('#ul1').find("select[name='WaterTypeId']").find("option:selected").text());
             

            $('#form1').find("select[name='ReadPersonId']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='ReadPersonId']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='ReadPersonId']").prev().find("em:first").text($('#ul1').find("select[name='ReadPersonId']").find("option:selected").text());
             
            $('#form1').find("select[name='MeterNature']").find("option:first").before("<option value=''>请选择</option>");
            $('#form1').find("select[name='MeterNature']").find("option:first").attr("selected", true);
            $('#form1').find("select[name='MeterNature']").prev().find("em:first").text($('#ul1').find("select[name='MeterNature']").find("option:selected").text());


            

            
            
            





            $(".click").click(function () {
                $(".tip").fadeIn(200);
            });

            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });

            $(".sure").click(function () {
                $(".tip").fadeOut(100);
            });

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });

            //用户添加
            $(".clickusersearch").click(function () {
                $(".tipusersearch").fadeIn(200);
            });
            $(".tiptopusersearch a").click(function () {
                $(".tipusersearch").fadeOut(200);
            });

            $(".sureusersearch").click(function () {
                $(".tipusersearch").fadeOut(100);
            });


            $(".cancelusersearch").click(function () {
                $(".tipusersearch").fadeOut(100);
            });

            //分表添加
            $(".clickfh").click(function () {
                $(".tipfh").fadeIn(200);
            });

            $(".tiptopfh a").click(function () {
                $(".tipfh").fadeOut(200);
            });
            $(".surefh").click(function () {
                $(".tipfh").fadeOut(100);
            });
            $(".cancelfh").click(function () {
                $(".tipfh").fadeOut(100);
            });

            //删除用户
            $(".clickdel").click(function (del) {
                $(".tipdel").fadeIn(200);
            });

            $(".tiptopdel a").click(function (del) {
                $(".tipdel").fadeOut(200);
            });
            $(".suredel").click(function (del) {
                $(".tipdel").fadeOut(100);
            });
            $(".canceldel").click(function (del) {
                $(".tipdel").fadeOut(100);
            });

            //修改用户
            $(".clickmodify").click(function () {
                $(".tipmodify").fadeIn(200);
            });

            $(".tiptopmodify a").click(function () {
                $(".tipmodify").fadeOut(200);
            });

            $(".suremodify").click(function () {
                $(".tipmodify").fadeOut(100);
            });

            $(".cancelmodify").click(function () {
                $(".tipmodify").fadeOut(100);
            });

            //修改分表
            $(".clickfhmodify").click(function () {
                $(".tipfhmodify").fadeIn(200);
            });

            $(".tiptopfhmodify a").click(function () {
                $(".tipfhmodify").fadeOut(200);
            });

            $(".surefhmodify").click(function () {
                $(".tipfhmodify").fadeOut(100);
            });

            $(".cancelfhmodify").click(function () {
                $(".tipfhmodify").fadeOut(100);
            });

        });
    </script>
    <script type="text/javascript">
        $(document).ready(function (e) {
            $(".select1").uedSelect({
                width: 345
            });
            $(".select2").uedSelect({
                width: 167
            });
            $(".select3").uedSelect({
                width: 150
            });
        });
    </script>
</head>
<body>
    <div class="place">
        <span>位置：</span>
        <ul class="placeul">
            <li><a href="#">首页</a></li>
            <li><a href="#">数据统计管理</a></li>
            <li><a href="#">用户统计</a></li>
        </ul>
    </div>
    <div class="rightinfo">
        <div class="tools">
            <ul class="toolbar">
                <li class="clickusersearch"><span><img src="/images/t04.png" /></span>用户统计</li>
                <li class="click"><span><img src="/images/t09.png" /></span>导出报表</li>
                <li class="click"><span><img src="/images/t08.png" /></span>打印报表</li>
            </ul>

        </div>
        <table class="imgtable">
            <thead>
                <tr>
                    <th>选择</th>
                    <th>用户编号</th>
                    <th>用户姓名</th>
                    <th>身份证号</th>
                    <th>联系电话</th>
                    <th>区域分布</th>
                    <th>区域名称</th>
                    <th>详细地址</th>
                    <th>水表编号</th>
                    <th>水表初值</th>
                    <th>用户状态</th>
                    <th>房屋类型</th>
                    <th>用水类别</th>
                    <th>水表性质</th>
                    <th>分表？</th>
                    <th>抄表人员</th>
                    <th>开户日期</th>
                    <th>备注</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {

                    <tr jsonModel="@(JsonConvert.SerializeObject(item,new JsonSerializerSettings{ReferenceLoopHandling = ReferenceLoopHandling.Ignore}))">
                        <td><input name="" type="checkbox" value="@(item.Id)" /></td>
                        <td>@(item.CustomerId)</td>
                        <td height="30px;">@(item.CustomerName)</td>
                        <td><a href="#">@(item.PersonId)</a></td>
                        <td>@(item.LinkPhone)</td>
                        <td>@(item.FirstArea)</td>
                        <td>@(item.SecondArea)</td>
                        <td>@(item.DetailAddress)</td>
                        <td>@(item.MeterNo)</td>
                        <td>@(item.MeterStart)</td>
                        <td>@(((Customer.CustomStatEnum)item.CustomerStat).ToDescription())</td>
                        <td>@(((Customer.HouseTypeEnum)item.HouseType).ToDescription())</td>
                        <td>@(item.WaterType?.TypeName)</td>
                        <td>@(((Customer.MeterNatureEnum)item.MeterNature).ToDescription())</td>
                        <td>@(item.ParentId == null ? "-" : "分表")</td>
                        <td>@(item.EmployeeInfo?.NAME)</td>
                        <td>@(item.OpenAccountDate?.ToString("yyyy/MM/dd"))</td>
                        <td>
                            @(item.DESCRIPTION)
                        </td>
                    </tr>
                }

            </tbody>
        </table>
        <div class="pagin">
            <div class="message">共<i class="blue">@(Model.TotalItemCount)</i>条记录，共&nbsp;<i class="blue">@(Model.TotalPageCount)&nbsp;</i>页</div>
            @Html.Pager(Model, BaseController.PagerOptions)
        </div>
        <form method="post"  id="form1">  
            <!--用户统计-->
            <div class="tipusersearch">
                <div class="tiptopusersearch"><img src="/images/t06.png" /><span>用户统计</span><a></a></div>
                <div class="tipinfousersearch">
                    <div class="tiprightusersearch">
                        <ul class="seachform">
                            <li>
                                <label>用户编号</label>
                                <input name="CustomerId" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>用户姓名</label>
                                <input name="CustomerName" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>身份证号</label>
                                <input name="PersonId" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>联系电话</label>
                                <input name="LinkPhone" type="text" class="scinput" />
                            </li>

                            @Html.Action("_LinkArea", "Common")

                            <li>
                                <label>详细地址</label>
                                <input name="DetailAddress" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>水表编号</label>
                                <input name="MeterNo" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>水表初值</label>
                                <input name="MeterStart" type="text" class="scinput" />
                            </li>
                            <li>
                                <label>用户状态</label>
                                <div class="vocation">
                                    @Html.Action("_EnumSelect", "Common", new { className = "Customer+CustomStatEnum", namespaces = "Kongt.Model", name = "CustomerStat", cssClass = "select3" })
                                </div>
                            </li>
                            <li>
                                <label>房屋类型</label>
                                <div class="vocation">
                                    @Html.Action("_EnumSelect", "Common", new { className = "Customer+HouseTypeEnum", namespaces = "Kongt.Model", name = "HouseType", cssClass = "select3" })
                                </div>
                            </li>
                            @Html.Action("_WaterType", "Common", new { id = "addsellssss" })
                            <li>
                                <label>抄表人员</label>
                                <div class="vocation">
                                    @Html.Action("_Employees", "Common", new { cssClass = "select3" })
                                </div>
                            </li>
                            <li>
                                <label>开户日期</label>
                                <div class="vocation">
                                    <select class="select3" name="OpenAccountDate">
                                        @{
                                            var dateStart = DateTime.Now.AddDays(-DateTime.Now.Day).AddDays(1);
                                            var dateEnd = DateTime.Now.AddMonths(1).AddDays(-DateTime.Now.Day);
                                            var tempDate = dateStart;
                                        }
                                        <option value="">请选择</option>
                                        @while (tempDate >= dateStart && tempDate <= dateEnd)
                                        {
                                            <option value="@(tempDate.ToString("yyyy/MM/dd"))">@tempDate.ToString("yyyy年MM月dd日")</option>
                                            tempDate = tempDate.AddDays(1);
                                        }
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>水表性质</label>
                                <div class="vocation">
                                    @Html.Action("_EnumSelect", "Common", new { className = "Customer+MeterNatureEnum", namespaces = "Kongt.Model", name = "MeterNature", cssClass = "select3" })
                                </div>
                            </li> 
                        </ul>
                    </div>
                </div>
                <div class="tipbtnusersearch">
                    <input name="" type="submit" class="sureusersearch" value="统计" />
                    &nbsp;
                    <input name="" type="button" class="cancelusersearch" value="取消" />
                </div>
            </div>
        </form>
    </div>
</body>
</html>
